// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef FORTUNESERVER_H
#define FORTUNESERVER_H

#include <QStringList>
#include <QTcpServer>

//! [0]
class FortuneServer : public QTcpServer
{
    Q_OBJECT

public:
    FortuneServer(QObject *parent = nullptr);
    void set_bin_file(QString path, QString name);

public slots:
    void error_to_gui(QString err);

protected:
    void incomingConnection(qintptr socketDescriptor) override; //

private:
    QStringList fortunes;
    QString bin_file_name_server;
    QString bin_file_name_server_path;

signals:
    void error(QString err);
};
//! [0]

#endif
